package net.hubt.itc.util;
import java.util.List;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import net.hubt.itc.data.RssItems;
import org.xml.sax.helpers.DefaultHandler;
public class RssReader extends DefaultHandler {
	private String rssUrl;
	public RssReader(String rssUrl) {
		this.rssUrl = rssUrl;
	}
	public List<RssItems> getItems() throws Exception {
		SAXParserFactory factory = SAXParserFactory.newInstance();
		SAXParser saxParser = factory.newSAXParser();
		RssParseHandler handler = new RssParseHandler();
		saxParser.parse(rssUrl, handler);
		return handler.getItems();
		
	}
}
